import { addImageList } from "./newsImageList";

export const addImageText = (editor) => {
  const optsText = {
    id: "image-text",
    label: "Image Text",
    classPrefix: "image-text",
    // 直接在这里定义您想要的基础样式和额外的样式
    style: `
      .image-text {
        padding: 0;
        margin: 0;
        list-style-type: none; /* 移除列表样式 */
        width: 100%;
        display: flex;
      }

      .image-text-container {
        padding-left: 0;
        margin: 0 auto;
        width: 96%;
        display: flex;
        align-items: flex-start;
        margin-bottom: 10px;
      }

      .image-text-container img {
        object-fit: cover;
        margin-right: 20px;
      }

      .image-text-text-container {
        width: 100%;
        list-style-type: none;
        padding-left: 0;
        margin: 0;
      }
    `,
    styleAdditional: `
      .image-text-text-container li {
        border-bottom: none;
        padding: 2px;
        margin-bottom: 5px;
      }
    `,
  };
  editor.otherNewsData = optsText;
  addImageList(editor);
  editor.BlockManager.add("image-text", {
    label: "图文混排(超出换行)",
    category: "新闻类",
    select: true,
    content: { type: "image-text" },
    media:`<svg xmlns="http://www.w3.org/2000/svg" height="30" width="30" viewBox="0 -960 960 960" width="24px" fill="#5f6368"><path d="M160-120q-33 0-56.5-23.5T80-200v-480h80v480h600v80H160Zm160-160q-33 0-56.5-23.5T240-360v-480h680v480q0 33-23.5 56.5T840-280H320Zm0-80h520v-400H320v400Zm80-120h160v-200H400v200Zm200 0h160v-80H600v80Zm0-120h160v-80H600v80ZM320-360v-400 400Z"/></svg>`
  });
};
